const gulp = require('gulp');
const babel = require('gulp-babel');

const paths = {
  scripts: ['src/components/**/*.{ts,tsx}'], // 脚本文件路径
  images:["src/images"]
};

function compileCJS() {
  const { scripts } = paths;
  return gulp
    .src(scripts)
    .pipe(babel()) // 使用gulp-babel处理
    .pipe(gulp.dest("lib/components"));
}

function compileImg(){
  const { images } = paths;
  return gulp
    .src(images)
    .pipe(gulp.dest("lib/images"));
}

// 并行任务 后续加入样式处理 可以并行处理
const build = gulp.parallel(compileCJS);

exports.build = build;

exports.default = build;